import { pipe, keys, join } from 'ramda';

export default (data: { [key: string]: string | number }): string =>
  pipe(
    keys,
    (items): string[] =>
      items.map(
        (item, index): string =>
          `${index === 0 ? '?' : '&'}${item}=${data[item]}`
      ),
    join('')
  )(data);
